{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
{\fonttbl\f0\froman\fcharset0 Times-Roman;\f1\fnil\fcharset0 LucidaGrande;\f2\fmodern\fcharset0 Courier;
}
{\colortbl;\red255\green255\blue255;\red0\green8\blue234;\red255\green255\blue47;\red24\green255\blue44;
\red174\green179\blue255;\red109\green109\blue109;\red179\green179\blue179;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}
{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}
{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid302\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{square\}}{\leveltext\leveltemplateid303\'01\uc0\u9642 ;}{\levelnumbers;}\fi-360\li2160\lin2160 }{\listname ;}\listid4}
{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid402\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid5}
{\list\listtemplateid6\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid501\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid502\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{square\}}{\leveltext\leveltemplateid503\'01\uc0\u9642 ;}{\levelnumbers;}\fi-360\li2160\lin2160 }{\listname ;}\listid6}
{\list\listtemplateid7\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid601\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid602\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid7}
{\list\listtemplateid8\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid701\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid702\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid8}
{\list\listtemplateid9\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid801\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid9}
{\list\listtemplateid10\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid901\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{circle\}}{\leveltext\leveltemplateid902\'01\uc0\u9702 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid10}
{\list\listtemplateid11\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1001\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid11}
{\list\listtemplateid12\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid12}
{\list\listtemplateid13\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid13}
{\list\listtemplateid14\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid14}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}}
\paperw11900\paperh16840\margl1440\margr1440\vieww14380\viewh13560\viewkind0
\deftab720
\pard\pardeftab720\ql\qnatural

\f0\b\fs48 \cf0 UEF [Unified Emulator Format] FILE FORMAT
\b0\fs32 \
Originally by Thomas Harte. Suggestions and additions to tape functionality by Fraser Ross and Greg Cook.
\f1 \uc0\u8232 
\f0 DRAFT file format version 0.10 / document draft 28 (revised 10/1/2006)\
\pard\pardeftab720\sa320\ql\qnatural
\cf2 \ul \ulc2 Chunk list\cf0 \ulnone \

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrt\brdrnil \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b\fs36 \cf0 Introduction
\b0\fs32 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The UEF file format is designed to store accurate images of the common media types associated with the BBC Micro, Acorn Electron and Atom. Tape storage is compatible with the CUTS/BYTE/Kansas City Format, and hence the format is also capable of storing software for non-Acorn systems such as the Altair 8800, PT SOL-20, Ohio Scientific, Compukit UK101, Nascom 1/2/3, Motorola MEK D1 6800 and SWTPC 6800 kit based computers.\
UEF files are chunk based and optionally compressed.\
If you spot any errors or omissions in this spec, or have any comments, then please {\field{\*\fldinst{HYPERLINK "mailto:thomas.harte@gmail.com"}}{\fldrslt \cf2 \ul e-mail me}}.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b\fs36 \cf0 Header and Chunk Template
\b0\fs32 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 All chunks conform to a common template:\
2 bytes: chunk id 
\f1 \uc0\u8232 
\f0 4 bytes: chunk length, not counting the 6 bytes that make up this header
\f1 \uc0\u8232 
\f0 <chunk data>\
Files begin with a 12 byte file header:\
10 bytes: Null terminated string "UEF File!"
\f1 \uc0\u8232 
\f0 1 byte: minor version number
\f1 \uc0\u8232 
\f0 1 byte: major version number\
Any changes that would require separate code paths in implementing software will result in a major version number increase. Changes that introduce a substantial new variation in the way media may be described will result in a minor version number increase.\
If most existing software could still utilise most existing and potential UEFs as though the specification had not changed then the version number is not affected.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b\fs36 \cf0 Covered Types of Media
\b0\fs32 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The following varieties of media are supported:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls1\ilvl0\cf0 {\listtext	\'95	}Tape images\
{\listtext	\'95	}Disc images\
{\listtext	\'95	}ROM images\
{\listtext	\'95	}State snapshots\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 There are a number of control chunks to give target machine hints but parsing of these is optional. There are also a small number of archive content chunks for information such as tape inlay transcriptions.\
Tape data chunks are ordered. UEF processing should begin at the start of the file, then proceed according to the tape hardware to the end.\
Any non-tape chunks encountered whilst dealing with a tape UEF should only be processed when they are crossed by tape processing mechanisms. So, for example, a tape image may include a memory snapshot of a previously stored high score table stored straight after the end of the game data.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b\fs36 \cf0 Conventions
\b0\fs32 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 UEF files may and commonly will be be gzip compressed, but the suffix remains unchanged. The gzip compressed version has the normal gzip 'magic number' as its first two bytes, so the well known ZLib can be used to work with either type seemlessly.\
All data is little endian unless stated otherwise.\
Floating point numbers are stored in IEEE 754 format, with intel 8087 byte ordering, giving 7 figure accuracy. Example C code to read a float and convert it into a floating point number in a platform neutral manner:\
\
\pard\intbl\itap1\pardeftab720\ql\qnatural

\f2\fs26 \cf0 	/* assume a four byte array named Float exists, where Float[0]\
	was the first byte read from the UEF, Float[1] the second, etc */\
\
	/* decode mantissa */\
	int Mantissa;\
	Mantissa = Float[0] | (Float[1] << 8) | ((Float[2]&0x7f)|0x80) << 16;\
\
	float Result = (float)Mantissa;\
	Result = (float)ldexp(Result, -23);\
\
	/* decode exponent */\
	int Exponent;\
	Exponent = ((Float[2]&0x80) >> 7) | (Float[3]&0x7f) << 1;\
	Exponent -= 127;\
	Result = (float)ldexp(Result, Exponent);\
\
	/* flip sign if necessary */\
	if(Float[3]&0x80)\
		Result = -Result;\
\
	/* floating point number is now in 'Result' */\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\f0\fs32 \cf0 To write:\
\
\pard\intbl\itap1\pardeftab720\ql\qnatural

\f2\fs26 \cf0 	/* assume that the floating point number 'Value' is to be stored */\
	unsigned char Float[4];\
\
	/* sign bit */\
	if(Value < 0)\
	\{\
		Value = -Value;\
		Float[3] = 0x80;\
	\}\
	else\
		Float[3] = 0;\
\
	/* decode mantissa and exponent */\
	float mantissa;\
	int exponent;\
	mantissa = (float)frexp(Value, &exponent);\
	exponent += 126;\
\
	/* store mantissa */\
	Uint32 IMantissa = (Uint32)(mantissa * (1 << 24));\
	Float[0] = IMantissa&0xff;\
	Float[1] = (IMantissa >> 8)&0xff;\
	Float[2] = (IMantissa >> 16)&0x7f;\
\
	/* store exponent */\
	Float[3] |= exponent >> 1;\
	Float[2] |= (exponent&1) << 7;\
\
	/* now output Float[0], then Float[1], etc */\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\f0\fs32 \cf0 All strings are ASCII and NULL terminated, and the linefeed character, ASCII code 10 (decimal) is used to deliminate new lines. The only other ASCII control character (i.e. with decimal values less than 32) recognised is 'tab', value 9. Others should be completely ignored.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Notes on pseudo-code and understanding the tape data chunks
\b0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This document contains pseudo-code for every tape chunk that outputs anything other than a silent wave. Several conventions of language are observed.\
Non-silent audio is composed from segments of a sine wave.\
A 
\i\b pulse
\i0\b0  is a 180 degree segment of sine wave. This will normally appear to be a single loop of wave output - a signal starting at zero, then arching in one direction away from zero before returning there.\

\i\b Phase
\i0\b0 , which is initially 180 degrees, dictates the region of sine wave used for pulses.\
There are two named varieties of pulse - 
\i\b high pulse
\i0\b0  and 
\i\b low pulse
\i0\b0 , named after the way they appear when phase remains at the default setting. A high pulse is the region between 180+phase and 360+phase degrees (appearing as a 'groove' if phase is 180). A low pulse is the region between 0+phase and 180+phase degrees (appearing as a 'pit' if phase is 180).\
A 
\i\b cycle
\i0\b0  is a low pulse followed by a high pulse, i.e. a complete sine cycle from 0+phase to phase+360 degrees.\
The (modal) 
\i\b base frequency
\i0\b0  determines the frequencies at which the sine wave should be generated. 
\i\b Base tone
\i0\b0  is composed of repeated cycles at the base frequency. 
\i\b Carrier tone
\i0\b0  is composed of repeated cycles at twice the base frequency.\
The data encoding format dictates how bits are encoded as patterns of sine wave.\
In the ordinary ("1200 baud") data encoding format, a zero bit is encoded as one complete cycle at the base frequency. A one bit is two complete cycles at twice the base frequency.\
In the alternate ("300 baud") data encoding format, a zero bit is encoded as four complete cycles at the base frequency. A one bit is eight complete cycles at twice the base frequency.\
Note: when encoded with the same data encoding format, zero and one bits always take the same amount of time to output.\
When UEF files are initially opened, default values are a base frequency of 1200Hz, a data encoding format of 1200 baud and a phase of 180 degrees. This produces the most common 1200 baud data storage scheme used by the BBC Micro and Acorn Electron.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Simplified Usage
\b0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Emulator authors seeking simplicity may ignore any chunk that deals with the tape wave form at pulse or cycle level and rationalise chunk &0104 to a whole number of stop bits while retaining 99.9% compatibility with real world UEFs.\
Those looking to implement 80% compatibility with UEF files without a detailed emulation of the underlying tape hardware are recommended to implement of chunks &0100, &0110 and &0111 and may otherwise assume 1200 baud (i.e. 1200Hz base wave, 1200 baud data encoding, phase 180).\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Colour Spaces
\b0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 With all greyscale images, the colour values simply represent colour intensity, but for colour images, one of the following conventions applies:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls2\ilvl0
\b \cf0 {\listtext	\'95	}8 bpp:
\b0  colours are paletted\
\ls2\ilvl0
\b {\listtext	\'95	}16 bpp:
\b0  the 16 bit word is split into four nibbles, and is intended to be decoded so as to produce an r:g:b value with each component described in 8 bits. The most significant nibble is the high nibble of the red byte. The second most significant nibble (the other nibble of the high byte) is the high nibble of the green byte. The third most significant nibble is the high nibble blue byte. The least significant nibble is the 'offset' part, as it should used as the low nibble of the red, green and blue bytes. So, for example, the value &abcd describes the RGB colour (0xad, 0xbd, 0xcd).\
\ls2\ilvl0
\b {\listtext	\'95	}24 bpp: 
\b0 again an r:g:b triplet is formed, with each colour being represented by a byte value. The most significant byte is the red byte, the middle-most significant byte is the green byte, and the least significant byte is the blue byte. Hence the value &abcdef describes the RGB colour (0xab, 0xcd, 0xef).\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Bit Multiplexing
\b0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This file format has support for the special emulator feature I have badly named 'bit multiplexing' until a better name can be found. Bit multiplexing supplies the emulator with additional information so that old programs may be run to produce a greater quality of output.\
This feature is really only for emulation use of UEF files and ignoring bit multiplexing will have no effect on the accuracy of your tool to original hardware. This feature is expected to be ignored by most authors.\
A separate document on multiplexing is in preparation.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat3 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b\fs36 \cf0 All Defined Chunks
\b0\fs32 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf2 \ul &00xx set\cf0 \ulnone  - Content information
\f1 \uc0\u8232 
\f0 \cf2 \ul &01xx set\cf0 \ulnone  - Tape chunks
\f1 \uc0\u8232 
\f0 \cf2 \ul &02xx set\cf0 \ulnone  - Disc chunks
\f1 \uc0\u8232 
\f0 \cf2 \ul &03xx set\cf0 \ulnone  - ROM chunks
\f1 \uc0\u8232 
\f0 \cf2 \ul &04xx set\cf0 \ulnone  - State snapshots
\f1 \uc0\u8232 
\f0 \cf2 \ul &FFxx set\cf0 \ulnone  - reserved / non-emulator portable\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 &00xx set - Content information\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0000
\b0  - origin information chunk\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk holds a few lines of text describing where the file came from, or naming the utility that created it. Text should be automatically formatted by any tool utilising this information, so new lines should only be used for breaking paragraphs.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0001
\b0  - game instructions / manual or URL\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Text holding a copy of the game manual, or some notes on the game generally. Alternatively, this may contain a URL to a more meaningful resource, such as a local or internet based web site, in which case the first five characters should be "URL: " ("URL:" followed by a single space) followed by the URL.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0003
\b0  - inlay scan\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 A scan of the inlay image.\
\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Width of image\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Height of image\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 4\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 BPP of image in low 7 bits, high bit set if image is grey scale.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 [5 if 8bpp paletted, non-existant otherwise]\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 768\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 If intended for display at 8bpp other than grayscale, then a 256 colour palette follows here, arranged in b, g, r triplets (bytewise you see the b value, then the g, then the r) each representing a linear scale from 0 (no quantity of this colour present) to 255, with the first palette entry coming first in the list.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth2480\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth2500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth16960\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 [773 if 8bpp paletted, 5 otherwise]\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Width*Height*(bits per pixel)\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 The image data itself, stored in English reading order and following the usual UEF space conventions.\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk is intended for small, low quality scans, suitable for display within an emulator.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0005
\b0  - target machine chunk\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Describes a type of hardware for which this file is targetted. Multiple chunks may be present - e.g. some tapes contain a BBC and Electron version of their game, the only difference being which file is loaded last. In general, this sets a 'minimum' required hardware level, so that emulators can alert a user when a UEF requires hardware that isn't emulated.\
This chunk is exactly 1 byte long. In that byte, the most significant nibble holds one of the following values:\
0 - this file is aimed at a BBC Model A
\f1 \uc0\u8232 
\f0 1 - this file is aimed at an Electron
\f1 \uc0\u8232 
\f0 2 - this file is aimed at a BBC Model B
\f1 \uc0\u8232 
\f0 3 - this file is aimed at a BBC Master
\f1 \uc0\u8232 
\f0 4 - this file is aimed at an Atom\
The least significant nibble holds one of the following values:\
0 - this file will work well with any keyboard layout, or a layout preference is not specified
\f1 \uc0\u8232 
\f0 1 - this file will work best if all keys are left in the same places relative to each other as on the emulated machine (e.g. the IBM PC key physically above '/' produces ':' as per theoriginal hardware, even though it has a ' on it on UK keyboards)
\f1 \uc0\u8232 
\f0 2 - this file will work best with a keyboard mapped as per the emulating computer's (e.g. on a UK keyboard pressing shift+0 on a keyboard will produce ')', rather than '@' as on a BBC or Electron)\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0006
\b0  - bit multiplexing information\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Contains one bytes, for determining what, if any, bit multiplexing information is provided by this UEF.\
This byte is known as the 'bit multiplier'. Take the value of this byte and multiply it by 4 to get the number of bits that are stored for every bit that the original machine had. For 32bit platforms such as wintel, this byte will normally have the value '1' - indicating that 1*4 bits are available for every single in the original - i.e. every 8bit value is shadowed by a 32bit value.\
Older UEF definitions had a second byte defined for this chunk, but it is no longer used and need not be present.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0007
\b0  - extra palette\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk holds the palette for multiplexed modes with colour depths of less than 16bit. Contains (chunk length / 3) entries, where each entry is a red byte followed by a green byte, followed by a blue byte, each specifying a level in the full byte range of 0->255. If the chunk length has a remainder when divided by three, the last 'remainder' bytes should be ignored.\
The first value you read is the r,g,b value of colour 0 is the palette. The second value is colour 1, and so on. The values for entries referred to in software but not described here are undefined.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0008
\b0  - ROM hint\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk can be used to specifically say whether a particular ROM or class of ROM is required or not.\
If the lsb of the first byte is 0, the chunk is requesting a ROM or set of ROMs be absent. If it is 1, the chunk is instead requesting presence.\
If the second byte has value 0, a specific ROM is being named. In which case a NULL terminated string follows, which should be matched with the ROM encoded ROM name. For information on how to decipher the ROM name from a ROM file, see the BBC AUG. Another byte then follows the NULL terminator. If its lsb is 0, the string given is exactly equivalent to the ROM name. If the lsb is instead 1, then instead the string, if length n, names only the first n characters of the ROM it is thinking of. In this case it is sufficient for the emulator to find any ROM with those first n characters.\
Otherwise, if the lsb of the second byte was 0, a ROM type follows in the third byte. It has one of the following values:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls3\ilvl0\cf0 {\listtext	\'95	}0 - all ROMs [*]\
{\listtext	\'95	}1 - all ROMs except BASIC [*]\
{\listtext	\'95	}2 - any DFS ROM\
{\listtext	\'95	}3 - any ADFS ROM\
{\listtext	\'95	}4 - any filing system ROM [*]\
{\listtext	\'95	}5 - any language ROM [*]\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Of course if this chunk requests the presence 'any ADFS ROM', it means just one, whereas if it wants them absent it means the absence of any. Requests for ensuring presence of types marked with a * above is ignored - those types are included purely for the purpose of requesting absence.\
There may be multiple ROM hints, in which case the order of these chunks is important. They are followed like a list of instructions. So if the first chunk says to remove any ADFS ROM's, and then a second one says to install any ADFS ROM's, then the UEF is in total requesting the presence of exactly one ADFS ROM. However an emulator need not take action if it finds a constraint is already satisfied, so it is meaningless to request more than one ADFS ROMs.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0009
\b0  - short title\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 A short title, in ASCII, suitable for use as the title bar to an emulator, or display in a file selector.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &000a
\b0  - visible area\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 For UEFs which use only a portion of the output screen, this chunk allows the total visible area to be restricted to a particular rectangle. Contents are:\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth7060\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth7060\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Lowest visible x value - i.e. 'left' of visible rectangle\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth7060\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Lowest visible y value - i.e. 'top' of visible rectangle\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth7060\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 4\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Highest visible x value - i.e. 'right' of visible rectangle\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1500\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth7060\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 6\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Highest visible y value - i.e. 'bottom' of visible rectangle\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 For the BBC/Electron, all coordinates are assumed to be measured on a mode 0 style 640x256 output, regardless of the display mode in use at any particular time. Atom displays are assumed always to be measured per the native display mode.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 &01xx set - Tape chunks\
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0100
\b0  - implicit start/stop bit tape data block\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk represents byte data stored on a cassette with Acorn's default start/stop bits (which are not reproduced).\
The least significant bit of the first byte is the first bit to appear on the tape, the most significant the 8th, and so on. Hence bytewise values are the same as the bytes stored on cassette.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0 \
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls4\ilvl0\cf0 {\listtext	\'95	}while bytes remain in UEF chunk\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls4\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output a zero bit (the start bit)\
{\listtext	
\f1 \uc0\u9702 
\f0 	}read a byte from the UEF chunk, store it to NewByte\
{\listtext	
\f1 \uc0\u9702 
\f0 	}let InternalBitCount = 8\
{\listtext	
\f1 \uc0\u9702 
\f0 	}while InternalBitCount > 0\
\pard\intbl\itap1\tx1660\tx2160\pardeftab720\li2160\fi-2160\ql\qnatural
\ls4\ilvl2\cf0 {\listtext	
\f1 \uc0\u9642 
\f0 	}output least significant bit of NewByte\
{\listtext	
\f1 \uc0\u9642 
\f0 	}shift NewByte right one position\
{\listtext	
\f1 \uc0\u9642 
\f0 	}decrement InternalBitCount\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls4\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output a one bit (the stop bit)\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0101
\b0  - multiplexed data block\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The chunks that store meaningful tape data that may be multiplexed are &0100 and &0102. If either of these is immediately followed by a &0101 chunk then that chunk contains exactly the same information as its predecessor, except that the data fields are expanded to contain multiplexed data.\
If this chunk appears after any chunk that is neither &0100 nor &0102 then it has no meaning and should be ignored.\
Older UEFs may use &0103 as a synonym for &0101.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0102
\b0  - explicit tape data block\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Chunk &0102 is a raw representation of data bits stored on cassette. Unlike chunk &0100 there are no implicit start/stop bits.\
The first byte of this chunk is used to calculate chunk length at the bit level. Only the first (chunk length * 8) - (value of first byte) bits are used in this chunk.\
Bit ordering is as per &0100, so the least significant bit of any byte is the first bit on the tape.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0 \
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls5\ilvl0\cf0 {\listtext	\'95	}compute bit count for chunk - get chunk length, multiply it by 8 and subtract the value of the first byte. Store it to BitCount\
{\listtext	\'95	}store zero to CurrentBit\
{\listtext	\'95	}while CurrentBit < BitCount\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls5\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}if (CurrentBit mod 8) = 0, read a new data byte from the chunk to NewByte\
{\listtext	
\f1 \uc0\u9702 
\f0 	}output the least significant bit of NewByte\
{\listtext	
\f1 \uc0\u9702 
\f0 	}shift NewByte right one position\
{\listtext	
\f1 \uc0\u9702 
\f0 	}increment CurrentBit\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0104
\b0  - defined tape format data block\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk holds byte data with specified non-standard start/stop/parity bits. It is analogous to &0100 in that bytes of data are read from the UEF then packaged to produce the tape signal. Unlike &0100, block packaging may include arbitrary stop and parity bits. Like &0100 blocks always have an implicit start bit.\
While processing this chunk, bytes are read from the source UEF and packaged into packets. The packet format is defined by the first three bytes in the chunk.\
The first byte holds the number of data bits per packet, not counting start/stop/parity bits.\
The second byte holds the ascii code for 'N', 'E' or 'O', which specifies that parity is not present, even or odd.\
The third byte holds information concerning stop bits. If it is a positive number then it is a count of stop bits. If it is a negative number then it is a negatived count of stop bits to which an extra short wave should be added.\
Positive numbers should be used wherever possible. Reproductions of original BBC and Electron material should only produce positive numbers if correctly encoded.\
The total number of packets is equal to the chunk's length minus three. Bits in bytes are stored as in block &0100, i.e. the least significant bit should appear on cassette first.\
Data blocks are always stored in the chunk as whole byte quantities. If the number of data bits is seven then the most significant bits of all bytes in the chunk are unused and should be zero.\
Normal start bits should always be inserted into data, as per the implicit data chunk, &0100.\
For the BBC/Electron, the following formats may be encountered: 7E1, 7E2, 7O1, 7O2, 8E1, 8N2, 8O1. Format 8N1 would produce the same output as chunk &0100.\
For the Atom, data format will usually be 8N-1.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0  (NB: see phase notes at head of document)\
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls6\ilvl0\cf0 {\listtext	\'95	}let NumBitsPerPacket = number of data bits, per first byte in chunk\
{\listtext	\'95	}make a note of parity, per second byte in chunk\
{\listtext	\'95	}let StopBitCount = number of stop bits, per third byte in chunk\
{\listtext	\'95	}if StopBitCount < 0 then negative StopBitCount (making it positive), make a note to incorporate an extra short wave\
{\listtext	\'95	}while bytes remain in UEF chunk\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls6\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output start bit - always a zero\
{\listtext	
\f1 \uc0\u9702 
\f0 	}read a byte from the UEF chunk, store it to NewByte\
{\listtext	
\f1 \uc0\u9702 
\f0 	}let InternalBitCount = NumBitsPerPacket\
{\listtext	
\f1 \uc0\u9702 
\f0 	}while InternalBitCount > 0\
\pard\intbl\itap1\tx1660\tx2160\pardeftab720\li2160\fi-2160\ql\qnatural
\ls6\ilvl2\cf0 {\listtext	
\f1 \uc0\u9642 
\f0 	}output least significant bit of NewByte\
{\listtext	
\f1 \uc0\u9642 
\f0 	}shift NewByte right one position\
{\listtext	
\f1 \uc0\u9642 
\f0 	}decrement InternalBitCount\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls6\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}if parity is required, output parity bit\
{\listtext	
\f1 \uc0\u9702 
\f0 	}let InternalStopCount = StopBitCount\
{\listtext	
\f1 \uc0\u9702 
\f0 	}while InternalStopCount > 0\
\pard\intbl\itap1\tx1660\tx2160\pardeftab720\li2160\fi-2160\ql\qnatural
\ls6\ilvl2\cf0 {\listtext	
\f1 \uc0\u9642 
\f0 	}output a stop bit - always a one\
{\listtext	
\f1 \uc0\u9642 
\f0 	}decrement InternalStopCount\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls6\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}if StopCycleCount was negative when first read then output a single wave (i.e. low pulse, then high pulse) at twice the base frequency\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0110
\b0  - carrier tone (previously referred to as 'high tone')\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 A run of carrier tone (i.e. cycles with a frequency of twice the base frequency), with a running length described in cycles by the first two bytes.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0  (NB: see phase notes at head of document)\
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls7\ilvl0\cf0 {\listtext	\'95	}read cycle count for chunk - first two bytes, store to CycleCount\
{\listtext	\'95	}while CycleCount > 0\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls7\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output a single cycle at twice the current base frequency\
{\listtext	
\f1 \uc0\u9702 
\f0 	}decrement WaveCount\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0111
\b0  - carrier tone (previously 'high tone') with dummy byte\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk represents a run of carrier tone followed by 10 bits of data and then a second run of carrier tone.\
This four byte chunk is composed of two sets of two bytes - the first two describe the number of cycles in the tone before the dummy byte, and the second two describe the number of cycles in the tone after the dummy byte. The dummy byte always has value &AA.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0  (NB: see phase notes at head of document)\
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls8\ilvl0\cf0 {\listtext	\'95	}read 'before' cycle count for chunk - first two bytes, store to CycleCount\
{\listtext	\'95	}while CycleCount > 0\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls8\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output a single cycle at twice the current base frequency\
{\listtext	
\f1 \uc0\u9702 
\f0 	}decrement CycleCount\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls8\ilvl0\cf0 {\listtext	\'95	}output the folowing bit sequence (in English reading order): 0, 0, 1, 0, 1, 0, 1, 0, 1, 1\
{\listtext	\'95	}read 'after' cycle count for chunk - final two bytes, store to CycleCount\
{\listtext	\'95	}while CycleCount > 0\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls8\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}output a single cycle at twice the current base frequency\
{\listtext	
\f1 \uc0\u9702 
\f0 	}decrement CycleCount\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0112
\b0  - integer gap\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 A gap in the tape - a length of time for which no sound is on the source audio casette. This chunk holds a two byte rest length counted relative to the base frequency. A value of n indicates a gap of 1/(2n*base frequency) seconds.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0116
\b0  - floating point gap\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 As per 0112, but the gap length is a floating point number measured in seconds.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0113
\b0  - change of base frequency\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The base frequency is a modal value, which is assumed to be 1200Hz when a UEF is open. If this chunk is encountered, the base frequency changes.\
This chunks contains a single floating point number, stating the new base frequency.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0114
\b0  - security cycles\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Security cycles are mainly found at the start of a run of carrier tone as an identification feature. Rarely they are at the end of a run of carrier tone. They consist of cycles of the base frequency and twice the base frequency and sometimes have a leading and/or trailing pulse.\
The first three bytes of this chunk (a 24 bit value) denote the number of 'cycles'. It is possible that the first and last may be only pulses.\
The fourth byte holds the ASCII code for 'P' or 'W'. If it is 'P', the first cycle is replaced by a single high pulse.\
The fifth byte again holds the ASCII code 'P' or 'W' which, if it is 'P' signifies that the last cycle is replaced by a low pulse.\
If the fifth byte is 'P' the fourth byte must be 'W' but has no relevance.\
If the 'cycles' follow a gap then the fourth byte can logically be 'P' or 'W'. If the 'cycles' follow other cycles then the fourth byte will logically be 'W'.\
This chunk never offends the general rule that the stored waveform consists only of gaps and pulses joined at zero crossings, and never creates an external or internal phase change.\
The UEF is encoded with eight 'cycles' per byte.
\f1 \uc0\u8232 
\f0 Slow cycles (at the base frequency) are denoted by 0 bits.
\f1 \uc0\u8232 
\f0 Fast cycles (at twice the base frequency) are denoted by 1 bits.
\f1 \uc0\u8232 
\f0 Bits are ordered such that the most significant bit represents the first cycle on the tape.
\f1 \uc0\u8232 
\f0 Spare bits in the last byte should preferably be 0 bits.
\f1 \uc0\u8232 
\f0 When the number of cycles is 1:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls9\ilvl0\cf0 {\listtext	\'95	}Only one of the fourth and fifth bytes may be 'P'\
{\listtext	\'95	}If the fourth byte is 'P' the fifth byte must be 'W' but has no relevance\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b \cf0 Examples:
\b0 \
The sequence of cycles LSLLLSSLSSLLSL will be stored as &0E, &00, &00, 'W', 'W', &9D, &2C. A sequence following other cycles having only 1 short pulse will be stored as &01, &00, &00, 'W', 'P', &00. A sequence following a gap having only 1 short pulse followed by 3 long waves will be stored as &04, &00, &00, 'P', 'W', &0E.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat7 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 PSEUDO-CODE
\b0  (NB: see phase notes at head of document)\
\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls10\ilvl0\cf0 {\listtext	\'95	}let NumCycles = number of stored cycles, the first three bytes in chunk\
{\listtext	\'95	}read the first bit from the chunk\
{\listtext	\'95	}if fourth byte of the chunk is an ASCII 'P' then output a single high pulse of the frequency implied by the bit just read, read new bit from chunk, decrement NumWaves\
{\listtext	\'95	}while NumWaves > 1\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls10\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}read next bit from chunk\
{\listtext	
\f1 \uc0\u9702 
\f0 	}if it is a zero, output a single cycle at the base frequency\
{\listtext	
\f1 \uc0\u9702 
\f0 	}if it is a one, output a single cycle at twice the base frequency\
{\listtext	
\f1 \uc0\u9702 
\f0 	}decrement NumWaves\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls10\ilvl0\cf0 {\listtext	\'95	}if NumWaves is equal to 1\
\pard\intbl\itap1\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
\ls10\ilvl1\cf0 {\listtext	
\f1 \uc0\u9702 
\f0 	}if fifth byte of chunk is an ASCII 'P' then output a single low pulse of the frequency implied by the final bit\
{\listtext	
\f1 \uc0\u9702 
\f0 	}else fifth byte of chunk must be an ASCII 'W' so output a single cycle of the frequency implied by the final bit\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0115
\b0  - phase change\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk contains a 16 bit unsigned value between 0 and 359, which determines the new phase.\
The majority of professional cassettes have waves shifted 0 or 180 degrees. Before one of these chunks is met (i.e. immediately after opening a UEF) the phase shift should be taken to be 180 degrees.\
If accurately representing a real life source tape, this chunk will only be found neighbouring a gap.\
See the section entitled 'Notes on phase' towards the top of this document for a proper discussion of the effect of phase on the output waveform.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0117
\b0  - data encoding format change\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk contains a 16 bit unsigned value and is used to select the new data encoding format. Upon opening a UEF, the "1200 baud" data encoding format described below should be adopted.\
If the value is 300 then the "300 baud" data encoding format is selected. From henceforth a '0' bit should be encoded as 4 cycles at the base frequency and a '1' bit as 8 cycles at twice the base frequency.\
If the value is 1200 then the "1200 baud" data encoding format is selected. From henceforth a '0' bit should be encoded as 1 cycle at the base frequency and a '1' bit as 2 cycles at twice the base frequency.\
All other values have undefined effect.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0120
\b0  - position marker\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk contains a string offering a textual description of the significance of the location it sits at within the file purely for the benefit of human beings.\
For example, Repton 3 contains the game followed by a level editor, so this chunk could be used to mark the start of the editor files - allowing an emulator user can easily skip straight to those if desired.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0130
\b0  - tape set info\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk allows the tape data mechanisms in UEF to be applied to a wide range of non-tape media, and sets the correct vocabulary and geometry for such use. All are modal values and UEF files are assumed to relate to single track, single sided tapes unless stated otherwise.\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1240\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19720\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1240\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19720\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Unsigned char - a byte that selects the appropriate vocabulary for the media. This does not place restrictions on the geometry of the media. Defined values are:\
\pard\intbl\itap2\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls11\ilvl0
\b \cf0 {\listtext	\'95	}0: 
\b0 'unit', 'position' (generic)\
\ls11\ilvl0
\b {\listtext	\'95	}1: 
\b0 'tape', 'channel' (the most common setting; channels are rarely used as most tapes are mono)\
\ls11\ilvl0
\b {\listtext	\'95	}2: 
\b0 'disc', 'track' (a record, CD or Minidisc)\
\ls11\ilvl0
\b {\listtext	\'95	}3: 
\b0 'tape', 'cue' (DAT, modern VHS soundtrack)\
\ls11\ilvl0
\b {\listtext	\'95	}4: 
\b0 'cartridge', 'track' (8-Track)\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1240\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19720\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Unsigned char - number of tapes. Maximum 127 tapes.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1240\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19720\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Unsigned char - Number of independent channels. Most cassettes are mono and this value will be 1. For disc media this byte contains the greatest number of audio tracks on any of the discs.\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0131
\b0  - start of tape side\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk deliminates the start position of a new tape side\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Unsigned char - Tape ID (0..126) and side bit. The maximum value of bits 0 to 6 is given by chunk &0130. Bit 7 signifies the side: 0 for side A, 1 for side B.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Unsigned char - Channel number, starting from 0 each side. The maximum is given by chunk &0130. For disc media this is the track number. For the sake of consistency the left channel of a stereo cassette is 0, the right channel 1.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 *\nestcell 
\pard\intbl\itap2\pardeftab720\sa320\ql\qnatural
\cf0 NULL terminated ASCII string - Side description. See chunk &0120. This is a space to record the version on this particular side (e.g. 'Electron' or 'Infinite Lives'), or the side itself in the manufacturer's preferred style (e.g. 'Side A', 'Side 1', 'Label side'). For Minidiscs this can record the track title.\
For compatibility purposes, string length should be restrained to a maximum of 255 characters.\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 &02xx set - Disc chunks\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0200
\b0  - disc info\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Gives an overview of the included disc thusly:\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 number of heads minus one. Values greater than 127 are invalid. Notice that since each head is considered to potentially read two sides of a disc platter, this value will be 0 for single sided and double sided disc images alike.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 sector length in bytes of implicitly defined disc sides\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 3\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 number of sectors per track within implicitly defined disc sides\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 4\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 number of tracks within implicitly defined disc sides\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth800\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth20160\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 5\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 a one byte filing system identifier, one of:\
\pard\intbl\itap2\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls12\ilvl0\cf0 {\listtext	\'95	}0: Undefined or not specified\
{\listtext	\'95	}1: Acorn 8271 DFS\
{\listtext	\'95	}2: Watford DFS 62\
{\listtext	\'95	}3: Acorn ADFS\
{\listtext	\'95	}4: Acorn 1770 DFS\
{\listtext	\'95	}5: Solidisk\
{\listtext	\'95	}6: OPUS DDOS\
\pard\intbl\itap2\pardeftab720\sa320\ql\qnatural
\cf0 The value of this is intended to tell you the catalogue type of the disc, and therefore if applicable which filing system ROM to 'recommend' to the user. This should be interesting to emulators that like to be vocal towards their users, but may also be used by those which like to implement their own filing systems compatible with the originals but without the hassle of a working hardware emulation.\
If a UEF wants to 'force' an emulator to adopt a particular ROM, it should use the ROM hint chunk &0008.\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0201
\b0  - single implicit disc side\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 First comes a one byte side/head id, in which the top bit represents the disc side - not set implies side 1, set implies side 2. The low 7 bits form the disc head id.\
Then following are (length of chunk - 1) bytes, stored such that the first byte is the first byte on the first sector of the first track, the (sector length)th byte is the first byte of the second sector, and so on.\
The stuff that is not normally seen by any component above the drive controller - the sector headers, (M)FM syncs, etc are left implicit. This chunk correlates directly to the SSD/DSD/ADF style of disc image.\
In many cases, there will not be as many bytes stored here as calculating (bytes per sector)*(sectors per track)*(tracks per side) seems to imply. This situation indicates that the value of the remaining bytes on the disc is not important, although the remaining sectors and tracks were formatted.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0202
\b0  - multiplexed disc side\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 As above but the disc data (after the side id) is multiplexed.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 &03xx set - ROM chunks\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0300
\b0  - standard machine rom\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Contains some sort of ROM, which are usually 16kb in size. The first byte is a type byte. It can contain one of the following values:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls13\ilvl0\cf0 {\listtext	\'95	}0 - type unspecified\
{\listtext	\'95	}1 - this is the OS ROM\
{\listtext	\'95	}2 - this is the BASIC ROM\
{\listtext	\'95	}3 - this is a language ROM\
{\listtext	\'95	}4 - this is a utility ROM\
{\listtext	\'95	}5 - a filing system ROM\
{\listtext	\'95	}6 - a hardware driver\
{\listtext	\'95	}7 - a game ROM\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The second byte is a slot recommendation, in which the high four bits should be zero. It is useful as on some hardware inserting a language or utility ROM in a slot above BASIC will cause it to boot instead, which may be the desired effect. For the OS ROM, this value is undefined, as it does not appear in a slot.\
It should be noted that a slot recommendation is only a hint - it may be ignored by software if required. E.g. Electron emulators will have difficulty honuring a slot recommendation for the BASIC ROM because on that hardware the BASIC ROM is a special case, occupying more than one slot, and similarly they may not allow any ROM to occupy slots 8 or 9 since they are reserved for the keyboard.\
The final part of this chunk is the ROM itself. As it will occupy a 16kb hole in the memory space, it shouldn't be larger than 16kb, however some ROMs are smaller (e.g. the Electron Plus 1 ROM is only 4kb), and should be considered to 'repeat' over the 16kb memory address range in that case.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0301
\b0  - multiplexed machine rom\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 As above, but the ROM data is multiplexed.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 &04xx set - State snapshots\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0400
\b0  - 6502 standard state\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Contains 8 bytes. The first is the 'update byte'. Common to all the snapshot chunks, the 'update byte' contains a non-zero value if the emulator is supposed to update this chunk when closed.\
The next five bytes are the a, p (status), x, y and s registers in that order. Then the two byte program counter follows.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0401
\b0  - Electron ULA state\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 For Electron emulators, this chunk contains the entire state of the ULA (the video circuits, cassette interface, sound generator and ROM pager). Format is:\

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrs\brdrw20\brdrcf6 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\qc

\b \cf0 Byte Offset\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Length\nestcell 
\pard\intbl\itap2\pardeftab720\qc
\cf0 Description\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural

\b0 \cf0 0\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 'Update byte'. Contains a non-zero value if the emulator should update this chunk when closed.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Interrupt control, followed by interrupt status (SHEILA &FE00). Should be used to determine which interrupts are currently active as well as which are enabled.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 3\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 SHEILA &FE02, followed by SHEILA &FE03 - in total screen start address\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 5\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 1\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 SHEILA &FE04 - cassette shift register\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 6\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 2\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 First byte: value of &FE05, principly for determining the value of the page enable bit. Second byte: ROM currently paged in (low 4 bits). High 4 bits are undefined.\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 8\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 10\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Remainder of SHEILA bytes, in ascending order (i.e. FE06, then FE07...)\nestcell \nestrow

\itap2\trowd \taflags0 \trgaph108\trleft-108 \trbrdrl\brdrs\brdrw20\brdrcf6 \trbrdrb\brdrs\brdrw20\brdrcf6 \trbrdrr\brdrs\brdrw20\brdrcf6 
\clvertalc \clshdrawnil \clwWidth1420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx2880
\clvertalc \clshdrawnil \clwWidth980\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx5760
\clvertalc \clshdrawnil \clwWidth19540\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrs\brdrw20\brdrcf6 \clbrdrl\brdrs\brdrw20\brdrcf6 \clbrdrb\brdrs\brdrw20\brdrcf6 \clbrdrr\brdrs\brdrw20\brdrcf6 \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 18\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 4\nestcell 
\pard\intbl\itap2\pardeftab720\ql\qnatural
\cf0 Number of 16Mhz cycles since last 'end of display' interrupt signal (regardless of whether this interrupt was actually enabled at the time).\nestcell \lastrow\nestrow
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0402
\b0  - WD1770 state\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 The assumption is made that a snapshot cannot be saved while the WD1770 is in the middle of an operation. The first byte, as with all other state snapshots, the 'update byte' - containing a non-zero value if the emulator should update this chunk when closed.\
The next four bytes are, in order : the status byte, the track byte, the sector byte, and the data byte.\
The final byte stores the disc drive status. As this varies from machine to machine, it is in a standard form. Bits 0->2 are the current drive number, in the range 0..7, bit 3 is the side select bit (high = side 2), and bit 4 is the double density select bit (high = double density).\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0403
\b0  - JIM paging register state\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 A two byte chunk - the usual 'update byte' followed by the last value written to the JIM paging register.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0410
\b0  - standard memory data\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Following the usual 'update byte', a second describes which memory is stored. It has one of the following values:\
\pard\intbl\itap1\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls14\ilvl0\cf0 {\listtext	\'95	}0 - this memory data comes from the standard RAM, located from location &0000 in the 6502 memory map upwards\
{\listtext	\'95	}1 - this memory data comes from shadow RAM\
{\listtext	\'95	}2 - this memory data is from the JIM page\
{\listtext	\'95	}255 - 'patch memory'\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Upon encountering 'patch memory', the next three bytes should be read. The first is a base address, with a value equivalent to one in the above table other than 255. The next two are an offset into that area to which the following data should be loaded.\
For example, suppose the chunk started &ff, &00, &12, &34 - then the following data should be loaded at position &3412 in normal RAM.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0411
\b0  - multiplexed memory data\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 As above, but with multiplexed data.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0412
\b0  - multiplexed (partial) 6502 state\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 Intended to coexist with chunk &0400. After the 'update byte', contains multiplexed entries for A, P, X and Y in that order.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &0420
\b0  - Slogger Master RAM Board State\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 After the 'update byte', this chunk contains one other byte indicating the mode of a Slogger Master RAM board. That byte may have value zero to indicate that the board is disabled, one to indicate that it is in turbo mode or two to indicate that it is in shadow mode.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat4 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa380\ql\qnatural

\b\fs48 \cf0 FFxx set - reserved / non-emulator portable\
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural

\b0\fs32 \cf2 \ul Back to chunk index\cf0 \ulnone \cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunks &FF01 -> &FFFF
\b0  - reserved / non-emulator portable\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 These chunks are reserved for you to do anything you like with. For example, my emulator stores a nice picture for its 'about' box, a GUI font and other small things in these chunks. An emulator should not assume it can understand these chunks unless it recognise the value of chunk &FF00.\
\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrr\brdrnil 
\clvertalc \clcbpat5 \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\ql\qnatural

\b \cf0 Chunk &FF00
\b0  - emulator identification string\cell \row

\itap1\trowd \taflags0 \trgaph108\trleft-108 \trwWidth22500\trftsWidth3 \trbrdrl\brdrnil \trbrdrt\brdrnil \trbrdrr\brdrnil 
\clvertalc \clshdrawnil \clwWidth22380\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt20 \clpadl20 \clpadb20 \clpadr20 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sa320\ql\qnatural
\cf0 This chunk is a NULL terminated string. It dictates which emulator output these FF?? chunks, and therefore allow your emulator to decide whether it knows their meaning.\
To ensure this doesn't clash with anyone else's chosen identification string, I suppose something like the name of your emulator is a good choice.\cell \lastrow\row}